<%- @page_title = "用户登陆 - 大满足日本语" -%>
<script type="text/javascript">
  $().ready(function() {
    $("#login_form").validate({
      rules: { "login": {
          required: true,
          rangelength: [5,20]
        },"password": {
          required: true,
          rangelength: [6,16]
        }
      },
      messages:{
        "login": {
          required: "请输入用户名",
          rangelength: "用户名长度必须在5-20个字符之间"
        },"password": {
          required: "请输入密码",
          rangelength: "密码长度必须在6-16个字符之间"
        }
      },
      errorPlacement: function(error,element){
        error.appendTo(element.next());
      }
    });
  });
</script>
<div id="main_body">
  <div class="sub_pannel">
    <div class="login_pannel">
      <div class="content">
        <h5>用户登录</h5>
        <% form_tag session_path,:id => 'login_form' do -%>
          <%unless flash.now[:notice].nil?%>
            <div id="message_box" style="display:block;">
              <div class="r_message"><%=flash.now[:notice]%></div>
            </div>
          <%end%>
          <p>
            <%= label_tag "login" ,"用户名:" ,:class=>'label' %>
            <%= text_field_tag 'login',nil,:class => "text" %>
            <span></span>
          </p>
          <p>
            <%= label_tag "password","密码:" ,:class=>'label' %>
            <%= password_field_tag 'password',nil,:class => "text" %>
            <span></span>
          </p>
          <p>
            <%= check_box_tag 'remember_me' %><span style="margin-left:5px;">记住我</span><span style="margin-left:5px;">忘记密码？</span>
          </p>
          <p class="p_submit">
            <%= submit_tag "确认登录"  ,:class=>'submit' %>
          </p>
        <%end%>
      </div>
    </div>
  </div>
</div>